<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
    <title>潜在客户列表</title>
    <meta name="decorator" content="default"/>
    <link rel="stylesheet" href="${ctxStatic}/bootstrap-table/bootstrap-table.css">
    <script src="${ctxStatic}/bootstrap-table/bootstrap-table.js"></script>
    <script src="${ctxStatic}/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>
    <script src="${ctxStatic}/bootstrap-table/config.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
        $("#select").click(function () {
            var ids = $.map($("#contentTable").bootstrapTable('getSelections'), function (row) {
                return row.id
            });
            alert("您选择了:" + ids);
        });
        $("#select").click(function () {
            $("#contentTable").bootstrapTable('refresh',
                {
                    url: "${ctx}/customer/potentialCustomerAddinfo/listAjaxData",//传url则从1开始不传则从当前页开始
                    query: {name: 'config by yourself'}
                }
            );
        });

        $("#contentTable").bootstrapTable($.fn.BTConfig({
            url: "${ctx}/customer/potentialCustomerAddinfo/listAjaxData",
            columns: [{
                field: 'state',
                checkbox: true,
                align: 'center'
            },
            {
                title: '主键',
                field: 'id',
                align: 'left'
            },
            {
                field: 'operate',
                title: '操作',
                align: 'center',
                events: {
                    'click .edit': function (e, value, row, index) {
                        alert('编辑这行: ' + JSON.stringify(row));
                    },
                    'click .remove': function (e, value, row, index) {
                        alert('删除这行: ' + JSON.stringify(row));
                    }
                },
                formatter: function (value, row, index) {
                    return [
                        '<a class="edit" href="javascript:void(0)" title="编辑">',
                        '<i class="icon icon-edit"></i>',
                        '</a>  ',
                        '<a class="remove" href="javascript:void(0)" title="删除">',
                        '<i class="icon icon-remove"></i>',
                        '</a>'
                    ].join('');
                }
            }
            ]
        }));
    });
    </script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/customer/potentialCustomerAddinfo/">潜在客户列表</a></li>
	</ul>
	<sys:message content="${message}"/>
	<div id="toolbar">
        <button id="search" class="btn btn-primary">
            查询<i class="icon icon-search icon-white"></i>
        </button>
        <button id="select" class="btn btn-info">
            选择<i class="icon icon-ok icon-white"></i>
        </button>
    </div>
	<table id="contentTable">
	</table>
</body>
</html>